from operator import itemgetter
L = [('Bob', 75), ('Adam', 92), ('Bart', 66), ('Lisa', 88)]
students  = [('Bob', 75), ('Adam', 92), ('Bart', 66), ('Lisa', 88)]

print(L[1])
def by_name(t):
    return  t[0]


def by_score(t):
    return t[1]

print(sorted(L, key=by_name))
print(sorted(L, key=by_score, reverse = True))

print(sorted(students, key=itemgetter(0)))
print(sorted(students, key=lambda t: t[1]))
print(sorted(students, key=itemgetter(1), reverse=True))
